//
//  BaseNaviController.m
//  FPTest
//
//  Created by zhaohong on 2017/11/7.
//  Copyright © 2017年 zhaohong. All rights reserved.
//

#import "BaseNaviController.h"

@interface BaseNaviController ()

@end

@implementation BaseNaviController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //去掉导航栏底部的横线
    [self.navigationBar setShadowImage:[UIImage new]];
    //设置导航栏背景
    [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navi_bg_64副本"] forBarMetrics:UIBarMetricsDefault];
    
    //添加右扫返回手势
    UISwipeGestureRecognizer *swipGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipGesture:)];
    swipGesture.direction = UISwipeGestureRecognizerDirectionRight;
    [self.view addGestureRecognizer:swipGesture];

    //默认开启手势右滑返回上一个界面
    self.isSwipGesture = YES;

}

//手势右划退出界面
- (void)swipGesture:(UISwipeGestureRecognizer *)gesture
{
    if(self.isSwipGesture){
        if (self.viewControllers.count > 1) {
            [self popViewControllerAnimated:YES];
        }
    }
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
